package example.book.mapper;

import example.book.model.BookInfos;
import example.book.model.PageRequest;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BookInfoMapper {
    @Insert("insert into book_info(book_name,author,count,price,publish,status) "+
            "values(#{bookName},#{author},#{count},#{price},#{publish},#{status});")
    public Integer addBook(BookInfos bookInfos);
    @Select("select * from book_info where status != 0 order by id desc limit #{offset},#{pageSize};")
    public List<BookInfos> queryBookMapper(PageRequest pageRequest);
}
